package com.mezz.bones.framework.base.domain.enums;

/**
 * 前缀说明
 * S系统问题
 * U用户端错误
 * T三方系统问题
 */
public enum ResponseCode {

    /**
     * S错误码 - 系统错误
     */
    SUCCESS("S200", "success"),
    SYS_ERROR("S30000","系统错误!"),
    SQL_ERROR("S300001","SQL异常"),
    API_DISABLE_ERROR("S300002","功能维护中..."),
    STRATEGY_NOT_FOUND("S300003","未找到策略对象"),
    FILTER_NOT_FOUND_EXCEPTION("S300004","filter not found"),
    JSON_FORMAT_ERROR("S300005","Json 格式化异常"),
    REPEAT_SUBMIT("S300006","请稍等！您操作过于频繁，请稍后再试。"),
    SPEL_EXPRESSION_ERROR("S300007","数据格式错误!"),
    DATA_FORMAT_ERROR("S300008","SpEL 表达式解析失败"),

    //参数异常
    PARAM_ERROR("S300009","参数异常"),

    TRY_LOCK_ERROR("S300010","系统繁忙,请稍后再试!"),

    API_NOT_FOUND("S300017","接口不存在"),


    /**
     * U错误码 - 用户端业务错误
     */

    USER_NOT_LOGIN("U400001","用户尚未登录"),
    USER_NOT_PERMISSION("U400003","用户权限不足"),
    DATA_NOT_FOUND("U400004","业务数据不存在!"),
    DATA_EXISTS("U400005","业务数据已存在!"),


    /**
     * T错误码 - 三方错误
     */
    WECHAT_TOKEN_TTL("T100001","微信token过期"),


    OVER("","");


    private final String code;
    private final String message;

    ResponseCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return code + " " + message;
    }
}
